﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using OgilvyOne.IDAL;
using OgilvyOne.DALFactory;
using OgilvyOne.Model;

namespace OgilvyOne.BLL
{
    public class VicoDealerBll
    {
        public DataSet GetAll()
        {
            return VicoDealerFactory.create().Query(null);
        }

        public DataSet Query(VicoDealerModel q)
        {
            return VicoDealerFactory.create().Query(q);
        }

        public int Add(VicoDealerModel model)
        {
            return VicoDealerFactory.create().Add(model);
        }
        public bool Update(VicoDealerModel model)
        {
            return VicoDealerFactory.create().Update(model);
        }
        public bool Del(int id)
        {
            return VicoDealerFactory.create().Del(id);
        }

        public VicoDealerModel GetModel(int id)
        {
            return VicoDealerFactory.create().GetModel(id);
        }
        #region arvato接口调试
        /// <summary>
        /// 获取经销商省份信息
        /// </summary>
        /// <param name="provinceID"></param>
        /// <returns></returns>
        public static string GetDealerProvince(string provinceID)
        {
            return VicoDealerFactory.create().GetDealerProvince(provinceID);

        }

        /// <summary>
        /// 获取经销商城市信息
        /// </summary>
        /// <param name="provinceId"></param>
        /// <param name="cityID"></param>
        /// <returns></returns>
        public static string GetDealerCity(string provinceId, string cityID)
        {

            return VicoDealerFactory.create().GetDealerCity(provinceId, cityID);
        }

        /// <summary>
        /// 获取经销商名称
        /// </summary>
        /// <param name="dealerID"></param>
        /// <returns></returns>
        public static string GetDealerName(string dealerID)
        {
            return VicoDealerFactory.create().GetDealerName(dealerID);
        }
        #endregion
    }
}
